<%@ page language="java" import="java.util.*,com.dao.*,com.beans.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
	String orderId = request.getParameter("orderId");
   	OrderInfo order=OrderDao.getOrderById(Integer.parseInt(orderId));
     //得到商品信息
    List<OrderGoods>  goodsList = OrderDao.getOrderGoodsList(Integer.parseInt(orderId));
    request.setAttribute("goodsList",goodsList) ;
    MemberInfo user=(MemberInfo)session.getAttribute("user");
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<title>订单详细信息</title>
<link  rel="stylesheet" type="text/css" href="css/basestyle.css"></link>

</head>
<body>
<div id="div_content">
<jsp:include page='<%= user==null?"../top.jsp":"../top_login.jsp" %>'></jsp:include>
<table id="maintable">	
  <tr>
    <td>&nbsp;</td>
    <td>
		<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
		  <tr  bgcolor="white">
			<td height="50" colspan="2" class="first_td"><IMG src="${pageContext.request.contextPath }/images/icon_goods.gif" width="150" height="29"></td>
		  </tr>
		  <tr  bgcolor="white">
			<td height="" colspan="2" align="left" class="text" style= "font-size:14pt" >
					  <table cellspacing="1" cellpadding="0" width="82%" border="0" bgcolor="#F7F3F7" align="center">
		   <tr  bgcolor="white">
			 <td style="padding-left: 210px; width=46%" class="text">订单编号：</td><td style="padding-left: 30px;width=54%;color:red"  class="text"><%=order.getOrderNo()%></td>
		    </tr>
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">商品金额：</td><td style="padding-left: 30px"  class="text"><%=order.getAmount()-order.getPostage()%></td>
			</tr>
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">订单邮费：</td><td style="padding-left: 30px"  class="text"><%=order.getPostage()%></td>
			</tr>
			
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">邮递方式：</td><td style="padding-left: 30px"  class="text"><%=order.getPostMethod()%></td>
			</tr>
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">付费方式：</td><td style="padding-left: 30px"  class="text"><%=order.getPayMethod()%></td>
			</tr>
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">订单状态：</td><td style="padding-left: 30px"  class="text"><%=order.getOrderState()%></td>
			</tr>
			<tr  bgcolor="white">
				<td style="padding-left: 210px" class="text">订单状态：</td><td style="padding-left: 30px"  class="text"><%=order.getOrderDate()%></td>
		   </tr>
		   
		</table>
			</td>
		  </tr>
		</table>
		<br/>
		<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F7F3F7">
            <tr bgcolor="#F7F3F7" valign="middle" align="center">
              <td height="30" class="blackTitle">商品图片</td>
              <td height="30" class="blackTitle">商品名称</td>
              <td height="30" class="blackTitle">商品价格</td>
              <td height="30" class="blackTitle">购买数量</td>
 
            </tr>
            <!--  Jstl 将得到的列表输出商品信息 -->
            <c:forEach var="goods" items="${goodsList}" varStatus="GoodsInJspLoop">
				<tr valign="middle" bgcolor="#FFFFFF"  align="center">
					  <td width="" align="center" >
						<a href="${pageContext.request.contextPath }/goods/goodsInfo.jsp?goodsId=${goods.goodsId}&operType=view" target=_blank>
						 <img src="${pageContext.request.contextPath }/picture.jsp?id=${goods.goodsId }"  width="60" height="60" border="1">
					  </a>
					  <br>
				  </td>
				  <td width="" class="text">
					${goods.goodsName} 
				  <br>
				  </td>
				  <td width="" class="text">
					   ￥${goods.price} 元
				  <br>
				  </td>
					  <td width="" class="text">
						${goods.saleCount} 
					  <br>
				  </td>
				  <td class="text">
				    ${GoodsInJsp.goodsNumber}<br>
				  </td>
				</tr>
				<tr>
				  <td colspan="4" height="2" bgcolor="#F7F3F7"><br></td>
				</tr>
			</c:forEach>
			</table>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="30">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>

</table>
<%@ include file="../bottom.jsp"%>
</div>
</body>
</html>
